
/*
 * Project: D-Link TR-069
 * 
 * File:   data.h
 * 
 * Authors: Taron Sargsyan <taronhsargsyan@gmail.com>		
 * 	    Suren Gharagyozyan	
 *
 * Created on September 20, 2011, 11:53 AM
 * 
 * 
 * This object is useful to get parameter values ane names from tr069 client 
 * and set  parameter values ane names in D-Base.
 * 
 * Copyright (C) 2011 D-Link Company.  All rights reserved.
 */

#ifndef _DIVID_H_
#define _DIVID_H_

typedef struct deviceId 
{
  char modelName[32];
  char serialNumber[32];
  char manufacturer[32];
  char oui[32];
  char productClass[32];
}deviceId;


struct out_par_name_ids
{
 char out_id[4]; 
 char out_id_1[4];
 
}out_par_name_id[128];


typedef struct modelName
{
  char* model_name;
}modelNameS;

extern modelNameS *mod_name_s;
extern deviceId *dev_id;
extern modelNameS *modelNamStr;

int set_xml_return;
char* ret_one_par_val_str;
char* ret_all_par_val_str;

void init_dev_id( char*,char*,char*,char*,char*,deviceId* );
int check_device_id( char* );
void set_device_db( char*,char*,char*,char*,char* );


int set_param_name_db( char* );//set parameter name in db
char* set_param_value_struct_xml( int,char*,char*,char*,char*);
char* create_set_value_xml(char*,char*,char*);
void set_value_answer_insert_db( char*,char* );

char* get_param_name_value(int,char*,char*);
char* create_getParam_name_value_xml(char*,char*,char*);

int get_param_name_db_id(char*);
void get_device_param_name_db_id(char*);

int check_model_name( char* );
int check_history( char*, int);

void set_unknow_model_name( char*,char* );
int check_unknown(char*);

int cpe_reboot( char* );
void set_cpe_reboot_db( char* );
int check_reboot_tbl( char* );

int check_fw_status( char* serial );
char* get_fw_download_xml( char* fw_xml,char* file_type,char* url,char* file_size);
char* get_check_and_fw( char* fw_xml,char* serial );
void done_fw_upgrade(int,char*);
char* get_model_id( char* model );

#endif